-
Notifications
You must be signed in to change notification settings - Fork 185
Conversation
Note most of this is tests. The only logic changes are in the |
d4e2166
to
572ace0
Compare
875d923
to
9d5c7b1
Compare
LGTM |
// it is possible for locate to not to be a fully normalized URL | ||
// if name was forced into not being of an absolute URL by normalize | ||
// so we run toAbsoluteURL again just in case | ||
return toAbsoluteURL(this.baseURL, load.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we could throw here if load.name
was not already absolute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I think we should throw, or just go with whatever we get blindly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this would mess up all uses of names like @system
, @traceur
. Or should these become schema names anyway?
Another question - in NodeJS, |
no, I think |
Because Or is the absolute URI check just |
well, my doc is only covering the browser side of it, ideally I will have time next week to work on the nodejs version of it, but I think on the nodejs runtime things are different, and the concept of URI is not longer valid since nodejs doesn't know about those. |
Thanks... would be really appreciated. That's why I assumed a |
The latest commit includes the throwing behaviour with the |
LGTM |
Great, thanks. |
@@ -88,7 +88,7 @@ function runTests() { | |||
var oldBaseURL = System.baseURL; | |||
System.baseURL = 'http://example.org/a/b.html'; | |||
|
|||
test('Normalize - No Referer', System.normalize('d/e/f'), 'd/e/f'); | |||
test('Normalize - No Referer', System.normalize('d/e/f'), 'http://example.org/a/d/e/f'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the idea was that if it doesn't start with './'
etc then it should do no normalization?
Meaning, that the only way to load these would be to first register them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch @arv, that's indeed the idea. if there is no d/*
pattern, it should throw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we expect all local paths to be loaded with ./
?
Eg:
<script type="module">
import "./app.js"
</script>
works by requesting relative to the baseURL, but app.js
does not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this test should be:
test('Normalize - No Referer', System.normalize('d/e/f'), 'd/e/f');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here was that paths would apply to these sorts of names to make them work, eg:
System.paths['d/*'] = 'http://site.com/path/*';
And if there was no path match, we can't fetch it?
We currently throw in locate if this was the case it has no schema - an alternative would be to move the throwing behaviour to fetch rather @caridy?
19921ce
to
cc53028
Compare
@@ -1,4 +1,4 @@ | |||
define(['./amd-dep'], function(dep) { | |||
define(['./amd-dep.js'], function(dep) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the .js
mandatory in AMD?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a tough one actually - most AMD doesn't use extensions, so we could still have the AMD layer itself add the extension. In CommonJS we could do something similar assuming the extension is optional. I'm not sure about this though.
ceb8afb
to
f98b78d
Compare
This has been replaced by #317. |
Here's a prototype for #218.
All tests passing.
Feedback welcome @caridy.